package com.yupi.yuoj.judge.codesandbox;

import com.yupi.yuoj.judge.codesandbox.impl.ExampleCodeSandbox;
import com.yupi.yuoj.judge.codesandbox.impl.RemoteCodeSandbox;
import com.yupi.yuoj.judge.codesandbox.impl.ThirdPartyCodeSandbox;

/**
 * @author hch
 * @version 1.0
 * @description 静态工厂模式
 * @date 2024/6/24 22:58
 */

public class CodeSandboxFactory {


    public static final CodeSandBox newInstance(String type){
        switch (type){
            case "example": return new ExampleCodeSandbox();
            case "remote":return new RemoteCodeSandbox();
            case "third":return new ThirdPartyCodeSandbox();
            default: return new ExampleCodeSandbox();
        }
    }
}
